from flask import Blueprint, request, jsonify
from app import db
from app.models.table2 import Table2

detailTables2_bp = Blueprint('detailTable2', __name__, url_prefix='/detailTable2')

# 通过id去查找tableContent
@detailTables2_bp.route('/<string:mid>', methods=['GET'])
def get_company(mid):
    detailTable2 = Table2.query.filter_by(mid=mid).first()
    if detailTable2:
        return jsonify(detailTable2.to_dict()), 200
    else:
        return jsonify({'message': 'detailTable2表没有数据'}), 404